<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" id="vp" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <title>我的</title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css">
    <link href="../../css/mui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="../../src/style.css">
    <link rel="stylesheet" href="../../src/iconfont/iconfont.css">
    <!-- <script src="../../js/rem.js"></script> -->

    <style>
        .me-top-Child {
            position: absolute;
            width: 0.74rem;
            height: 0.74rem;
            border-radius: 50%;
            border: solid 2px #fff;
            bottom: 15px;
            left: 1rem;
        }
        
        .me-top {
            padding-top: 0.27rem;
            margin: 0 0.24rem 0 0.26rem;
            border-bottom: solid 1px #F1F1F1;
            padding-bottom: 0.27rem;
        }
        
        #me #userinfo {
            background: #fff;
        }
        
        .me-top .name .child {
            font-size: 14px;
            letter-spacing: 0px;
            color: #282828;
            text-align: left;
        }
        
        #me .mui-grid-view.mui-grid-9 {
            border-top: none;
        }
        
        #me .mui-grid-view.mui-grid-9 .mui-table-view-cell {
            border-bottom: none;
            padding: 0;
        }
        
        #me .mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {
            font-size: 16px;
            margin-top: 0;
            color: #282828;
        }
        
        #me .mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-bodyTwo {
            font-size: 12px;
            color: #7b7b7b;
            padding-top: 0.12rem;
        }
        
        #me .mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-bodyTwo span {
            color: #ff6886;
        }
        
        #me .noborderRight {
            border-right: none;
        }
        
        .me_content_list .mui-grid-view.mui-grid-9 {
            border-left: none!important;
        }
        
        .me_content_list .mui-grid-view.mui-grid-9 .mui-table-view-cell {
            border-right: none!important;
        }
        
        .me_content_list .mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {
            border-bottom: solid 1px #f1f1f1;
            margin-left: 1.02rem;
            padding-bottom: 0.28rem;
            height: auto;
            padding-top: 0.05rem;
        }
        
        #me .me_content_list .mui-icon {
            margin-left: 0.27rem;
            font-size: inherit;
        }
        
        .me_content_list .mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn) {
            padding: 0!important;
        }
        
        #me .me_content_list .mui-table-view.mui-grid-view .mui-table-view-cell {
            padding-top: 0.27rem;
        }
        
        .mui-navigate-right:after,
        .mui-push-right:after {
            top: 8px;
        }
        
        .mr19 {
            margin-bottom: 0.19rem!important;
        }
        
        .mr19 .mui-media-body {
            border: none!important;
        }
        
        .parent {
            text-align: left;
            width: 200px;
        }
        
        .parent p {
            color: #282828!important;
            font-size: 18px!important;
            text-align: left!important;
            letter-spacing: 5px!important;
            float: left;
        }
        
        .parent .relation {
            display: table-caption;
            border-radius: 20px;
            color: #7b7b7b;
            border: solid 1px #e693a5;
            text-align: center;
            font-size: 10px;
            height: 15px;
            line-height: 15px;
            letter-spacing: 1px;
            width: 35px;
            margin-top: 2px;
        }
        
        .child .sex {
            width: 0.25rem;
            display: inline-block;
            margin: 0 2px;
        }
        
        .child .age {
            color: #7b7b7b;
            letter-spacing: 0px;
            font-size: 14px!important;
            margin-left: 2px;
        }
        
        .nameBig {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 3rem;
        }
        
        .me_content_list .mui-table-view .mui-table-view-cell img {
            width: auto;
        }
        
        #navtypeb {
            position: absolute;
            display: block;
            top: 0.1rem;
            right: 0.4rem;
            color: #ff0000;
            border: solid 1px #ff0000;
            border-radius: 100%;
            background: #FF3F40;
            color: #fff;
            width: 10px;
            height: 10px;
            font-size: 10px;
            text-align: center!important;
            line-height: 18px;
            z-index: 99;
            display: none;
        }
        
        .updatea {
            width: 80%!important;
        }
        
        .vipday {
            width: 80%!important;
        }
        
        #updatea {
            color: #bbb;
        }
        
        #vipday {
            color: #bbb;
        }
        
        .icon-setting {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 24px;
            color: #ffffff;
        }
    </style>
</head>

<body>
    <div id="userinfos">
        <div class="funcitonList" style="margin-top: 0px;padding-top: 10px;">
            <ul>
                <li id="takeaddress">
                    <span class="iconfont icon-location"></span>
                    <span>收货地址</span>
                    <span class="iconfont icon-enterinto_fill"></span>
                </li>
                <!-- <li id="myorder">
                    <span class="iconfont icon-edit"></span>
                    <span>我的订单</span>
                    <span class="iconfont icon-enterinto_fill"></span>
                </li> -->
                <li id="help">
                    <span class="iconfont icon-question-circle-fill"></span>
                    <span>帮助</span>
                    <span class="iconfont icon-enterinto_fill"></span>
                </li>
                <li>
                    <span class="iconfont icon-error-fill"></span>
                    <span>版本信息</span>
                    <span style="font-size: 14px;" id="updatea"></span>
                </li>
                
            </ul>
            <a id="exitbtn" href="#">退出登录</a>
        </div>
    </div>

    <script src="../../js/vue.min.js"></script>
    <script src="../../js/mui.js"></script>

    <script src="../../js/app.js"></script>
    <script src="../../js/jquery-1.8.3.min.js"></script>

    <script type="text/javascript">
        window.onload = function() {
            mui.init()
            var uid = "";
            var memberToken = '';
            var wgtVersion = '';
            var vipday = '';
            mui.plusReady(function() {

                plus.runtime.getProperty(plus.runtime.appid, function(inf) {
                    // 当前版本
                    console.log(inf)
                    wgtVersion = inf.version;;
                    document.getElementById('updatea').innerHTML = "V" + wgtVersion
                });
                var state = app.getState();

                uid = state.userid;
                memberToken = state.memberToken;
            });

            var userinfo = new Vue({
                el: '#userinfos',
                data: {
                    items: [],
                    update: wgtVersion
                },
                methods: {


                },

            });
            var backButtonPress = 0;
            mui.back()
            var titlestyle = {
                "render": "always",
                "popGesture": "hide",
                "bounce": "vertical",
                "bounceBackground": "#efeff4",
                "titleNView": { //详情页原生导航配置
                    backgroundColor: '#fff', //导航栏背景色
                    titleText: '', //导航栏标题
                    titleColor: '#000', //文字颜色
                    autoBackButton: true, //自动绘制返回箭头
                    splitLine: { //底部分割线
                        color: '#dfdfdf'
                    }
                }
            };
            //帮助
            document.getElementById("help").addEventListener('tap', function() {
                titlestyle.titleNView.titleText = "帮助中心";
                mui.openWindowWithTitle({
                    url: './help/index.html',
                    id: 'help',
                    preload: true,
                    show: {
                        aniShow: 'pop-in',
                        autoShow: true
                    },
                    styles: titlestyle,
                    waiting: {
                        autoShow: true
                    }
                });
            });




            
                //收货地址
            document.getElementById("takeaddress").addEventListener('tap', function() {

                mui.openWindowWithTitle({
                    url: './shop/takeaddress.html',
                    id: 'takeaddress',
                    preload: true,
                    show: {
                        aniShow: 'pop-in',
                        autoShow: true
                    },

                    waiting: {
                        autoShow: true
                    }
                });
            });
            //退出/注销
            document.getElementById('exitbtn').addEventListener('tap', function() {
                console.log("asdfasdf")
                var btnArray = [{
                    title: "注销当前账号"
                }, {
                    title: "直接关闭应用"
                }];
                plus.nativeUI.actionSheet({
                    cancel: "取消",
                    buttons: btnArray
                }, function(event) {
                    var index = event.index;
                    switch (index) {
                        case 1:
                            //注销账号
                            console.log(uid, memberToken)
                            mui.post(Apiurl+'index/login', {
                                uid: uid,
                                memberToken: memberToken
                            }, function(rsp) {
                                console.log(rsp)
                                if (rsp.status == 200) {
                                    // app.setState({});

                                } else {

                                }
                                localStorage.removeItem('$state')
                                var curr = plus.webview.currentWebview();
                                var wvs = plus.webview.all();
                                plus.webview.open('../login.html');
                                curr.back();
                                for (var i = 0, len = wvs.length; i < len; i++) {
                                    //关闭除setting页面外的其他页面
                                    if (wvs[i].getURL() == curr.getURL())
                                        continue;
                                    plus.webview.close(wvs[i]);
                                }
                            }, 'json');

                            break;
                        case 2:
                              localStorage.setItem('childid', JSON.stringify(24));
                            if (mui.os.ios) {
                                const threadClass = plus.ios.importClass("NSThread");
                                const mainThread = plus.ios.invoke(threadClass, "mainThread");
                                plus.ios.invoke(mainThread, "exit");
                            } else if (mui.os.android) {
                                plus.runtime.quit();
                            }
                            break;
                    }
                });
            }, false);
        }
    </script>
</body>

</html>